package com.woniuxy.scheduledtask;

import com.woniuxy.entity.dto.YiDTO;
import com.woniuxy.mapper.YiMapper;
import com.woniuxy.service.LogService;
import com.woniuxy.service.YiService;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;


/**
 * @program: tsm
 * @description: 定时任务
 * @create: 2024-10-16 20:28
 **/
@Component
public class Task {
    @Resource
    private YiService yiService;
    @Resource
    private YiMapper yiMapper;
    @Resource
    private LogService logService;


    @Scheduled(fixedRate = 600000)//10分钟执行一次
    public void clearLog(){
        logService.batchDelete();
    }

    @Scheduled(fixedRate = 6000000)//100分钟执行一次
    public void addET(){
        // 获取总记录数，查询的是运单
        yiService.queryException2();
    }
}
